<?php
/**
 * Created by PhpStorm.
 * User: ageng
 * Date: 2018/7/18
 * Time: 18:57
 */

namespace App\Http\Controllers\Api\Font;


use App\Facades\Services\ConvenienceStoreService;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class ConvenienceStoreController extends Controller
{
    //获取便利店所属栏目
    public function getStoreLevels(Request $request)
    {
        $rules = [
            'type_id' => 'required' //0为便利店 1为送餐服务
        ];

        $this->validate($request, $rules);

        return formatJsonResponse(ConvenienceStoreService::getStoreLevels($request->all()));
    }

    public function getStoreGoods(Request $request)
    {
        $rules = [
            'level_id' => 'required'
        ];

        $this->validate($request, $rules);

        return formatJsonResponse(ConvenienceStoreService::getStoreGoods($request->all()));
    }
}